home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / MPW181-5 / _SETUP.1 / sparc_obuffer.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-04-21  |  2.3 KB  |  82 lines

  1. /* sparc_obuffer.h
  2.  
  3.    Output buffer for Sun SPARC systems written by
  4.    Tobias Bading (bading@cs.tu-berlin.de)
  5.  
  6.    Idea and first implementation for u-law output with fast downsampling by
  7.    Jim Boucher (jboucher@flash.bu.edu)
  8.  
  9.    This program is free software; you can redistribute it and/or modify
  10.    it under the terms of the GNU General Public License as published by
  11.    the Free Software Foundation; either version 2 of the License, or
  12.    (at your option) any later version.
  13.  
  14.    This program is distributed in the hope that it will be useful,
  15.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  16.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17.    GNU General Public License for more details.
  18.  
  19.    You should have received a copy of the GNU General Public License
  20.    along with this program; if not, write to the Free Software
  21.    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
  22.  
  23. #ifndef SPARC_OBUFFER_H
  24. #define SPARC_OBUFFER_H
  25.  
  26. #ifdef SPARC
  27.  
  28. #include "all.h"
  29. #include "args.h"
  30. #include "obuffer.h"
  31.  
  32. // a class for direct sound output on SPARC 10 machines (dbri device)
  33. // or if ULAW is defined:
  34. // a class for direct sound output on SPARCs using a 8 kHz
  35. // 8-bit u-law audio device: (audioamd)
  36. class SparcObuffer : public Obuffer
  37. {
  38. private:
  39. #ifdef ULAW
  40.   ulawsample buffer[OBUFFERSIZE >> 1];        // mono only
  41.   ulawsample *bufferp;
  42. #else
  43.   int16 buffer[OBUFFERSIZE];
  44.   int16 *bufferp[MAXCHANNELS];
  45.   uint32 channels;
  46. #endif
  47.   static int audio_fd;
  48.  
  49.   static int open_audio_device (void);
  50. #ifdef Solaris
  51.   static void get_device_type (int fd, audio_device *);
  52. #else
  53.   static int get_device_type (int fd);
  54. #endif
  55.  
  56. public:
  57. #ifdef ULAW
  58.     SparcObuffer (MPEG_Args *maplay_args);
  59. #else
  60.     SparcObuffer (uint32 number_of_channels, MPEG_ARGS *maplay_args);
  61. #endif
  62.        ~SparcObuffer (void);
  63.   void    append (uint32 channel, int16 value);
  64.   void    write_buffer (int dummy);
  65.  
  66. #ifdef SEEK_STOP
  67.   void clear_buffer(void);
  68.   void set_stop_flag(void);
  69. #endif // SEEK_STOP
  70.  
  71. #ifdef ULAW
  72.   static BOOL class_suitable (uint32 number_of_channels, BOOL force_amd);
  73.     // returnvalue == False: no u-law output possible (class unsuitable)
  74. #else
  75.   static BOOL class_suitable (void);
  76.     // returnvalue == False: no 16-bit output possible (class unsuitable)
  77. #endif
  78. };
  79. #endif // SPARC
  80.  
  81. #endif // SPARC_OBUFFER_H
  82.